import java.awt.Point;
import java.util.HashMap;
import java.util.concurrent.LinkedBlockingQueue;

import stratego.java.ssm.piece.Piece;

public class scratch
{
	public static void main(String[] args)
	{
		LinkedBlockingQueue<HashMap<Point, Piece>> blockingQueue =
		        new LinkedBlockingQueue<HashMap<Point, Piece>>();
		final int expectedPieces = 40;
		class AddPlayer implements Runnable
		{
			LinkedBlockingQueue<HashMap<Point, Piece>>	location;
			HashMap<Point, Piece>			           locations;
			
			public AddPlayer(LinkedBlockingQueue<HashMap<Point, Piece>> location)
			{
				this.location = location;
				locations = new HashMap<Point, Piece>();
			}
			
			@Override
			public void run()
			{
				while (locations.size() != expectedPieces)
					locations.putAll(location.poll());
			}
			
			public HashMap<Point, Piece> getLocations()
			{
				return locations;
			}
		}
		AddPlayer player = new AddPlayer(blockingQueue);
		Thread temp = new Thread(player);
		temp.start();
		// Setup player
		// ...
		// ...
		// When done:
		try
		{
			temp.join();
		}
		catch (InterruptedException e)
		{
			e.printStackTrace();
		}
	}
}